package com.zmn.oms.services.interfaces.discount;

import com.zmn.oms.model.entity.discount.OrderDiscount;

import java.util.List;

/**
 * 类描述：定单优惠 service
 *
 * @author lujia
 * @date 2018/11/26 11:55
 */
public interface OrderDiscountService {

    /**
     * 根据订单id 查询优惠列表
     * @param orderIdList 订单id集合
     * @return 优惠列表集合
     */
    List<OrderDiscount> listOrderDiscountByOrderIdList(List<Long> orderIdList);

	/**
	 * 根据订单id和类别获取订单优惠
	 * @param orderId
	 * @param categ
	 * @return
	 */
	List<OrderDiscount> listByOrderIdAndCateg(Long orderId, Integer categ);

	/**
	 * 根据订单id和类别获取订单优惠 主库查询
	 * @param orderId
	 * @param categ
	 * @return
	 */
	List<OrderDiscount> listByOrderIdAndCategSrcMaster(Long orderId, Integer categ);

	/**
     * 通过工单获取优惠列表
     * @param orderId
     * @return
     */
    List<OrderDiscount> listByOrderId(Long orderId);

	/**
     * 通过工单获取优惠列表读主库
     * @param orderId
     * @return
     */
    List<OrderDiscount> listByOrderIdSrcMaster(Long orderId);

	/**
	 * 插入
	 * @param record
	 * @return
	 */
	Integer insert(OrderDiscount record);

	/**
	 * 更新售价
	 * @param record
	 * @return
	 */
	Integer updateSellAmount(OrderDiscount record);

	/**
	 * 删除
	 * @param orderDiscount
	 * @return
	 */
	Integer deleteByOrderIdAndCateg(OrderDiscount orderDiscount);


	/**
	 * 删除订单人工优惠
	 * @param orderId
	 * @return
	 */
	Integer deleteByArtificialDiscount(Long orderId);

	/**
	 * 删除
	 * @param orderId 根据订单Id查询
	 * @return
	 */
	Integer deleteByOrderId(Long orderId);

	Integer deleteByKey(Long discountId);

	/**
	 * 保存优惠列表
	 * @param orderDiscountList
	 */
	void insertOrderDiscountList(List<OrderDiscount> orderDiscountList);

	void updateByPrimaryKeySelective(OrderDiscount record);

	/**
	 * 批量更新
	 * @param orderDiscountList
	 */
	void updateBatch(List<OrderDiscount> orderDiscountList);
}
